#ifndef GAMEWIDGET_H
#define GAMEWIDGET_H

#include <QWidget>
#include <QPainter>
#include <QKeyEvent>
#include <QTimer>

class GameWidget : public QWidget {
    Q_OBJECT
public:
    explicit GameWidget(QWidget *parent = nullptr);
    void startGame();
    void resetGame();

protected:
    void paintEvent(QPaintEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

private slots:
    void updateGame();

private:
    struct Bullet { int x, y; bool active; };
    struct Enemy { int x, y; int type; bool active; };

    int playerX;
    std::vector<Bullet> bullets;
    std::vector<Enemy> enemies;
    int score;
    bool gameOver;
    QTimer *gameTimer;
};

#endif // GAMEWIDGET_H
